<div class="post-title"><h2><a href="<?php echo current_url();?>"><?php echo $title; ?></a></h2></div>

<div class="post-body">

<?php
	echo form_open('jenis_simp/'.$form_act, 'id="jenis_simp_form"');

	echo "<div id='error' class='error-message' ";

	if($this->session->userdata('ERRMSG_ARR'))
	{
		echo ">";
		echo $this->session->userdata('ERRMSG_ARR');
		$this->session->unset_userdata('ERRMSG_ARR');
	}
	else
	{
		echo "style='display:none'>";
	}
	
	echo "</div>";

	$data['class'] = 'input';
	if ($act == 'view') $data['disabled'] = TRUE;
?>
	
	<table width="300" border="0" align="center" cellpadding="2" cellspacing="0">						  
		<tr>
			<th><?php echo form_label('Jenis Simpanan *','id_jenis_simp'); ?></th>
			<td>
				
				<?php 
					$data['name'] = $data['id'] = 'id_jenis_simp';										
					$data['value'] = (set_value('id_jenis_simp')) ? set_value('id_jenis_simp') : $jenis_simp_data['id_jenis_simp'];
					$data['title'] = "Jenis simpanan tidak boleh kosong";
					echo form_input($data);
				?>
			</td>
		</tr>		
		<tr>
			<th><?php echo form_label('Bunga','bunga'); ?></th>
			<td>
				<?php 
					$data['name'] = $data['id'] = 'bunga';
					$data['value'] = (set_value('bunga')) ? set_value('bunga') : $jenis_simp_data['bunga'];
					$data['title'] = "Bunga tidak boleh kosong";						
					echo form_input($data);
				?>
			</td>
		</tr>	
		<tr>
			<th><?php echo form_label('Jumlah','jumlah'); ?></th>
			<td>
				<?php 
					$data['name'] = $data['id'] = 'jumlah';
					$data['value'] = (set_value('jumlah')) ? set_value('jumlah') : $jenis_simp_data['jumlah'];
					$data['title'] = "Jumlah tidak boleh kosong";						
					echo form_input($data);
				?>
			</td>
		</tr>
		<tr>
			<th><?php echo form_label('Tanggal Bulan Februari','tgl_feb'); ?></th>
			<td>
				<?php 
					$data['name'] = $data['id'] = 'tgl_feb';
					$data['value'] = (set_value('tgl_feb')) ? set_value('tgl_feb') : $jenis_simp_data['tgl_feb'];
					$data['title'] = "Tangal bulan Februari tidak boleh kosong";						
					echo form_input($data);
				?>
			</td>
		</tr>
		<tr>
			<th><?php echo form_label('Tanggal Bulan Lainnya','tgl_other'); ?></th>
			<td>
				<?php 
					$data['name'] = $data['id'] = 'tgl_other';
					$data['value'] = (set_value('tgl_other')) ? set_value('tgl_other') : $jenis_simp_data['tgl_other'];
					$data['title'] = "Tanggal bulan lainnya tidak boleh kosong";						
					echo form_input($data);
				?>
			</td>
		</tr>
		
	</table>
	
	<div class="buttons">
		<?php 
			if($act!='view')
			{ 
				echo form_submit('simpan','Simpan', "id = 'button-save'" );
				echo form_reset('reset','Reset', "id = 'button-reset'" );
				echo form_button(array('id' => 'button-cancel', 'content' => 'Batal', 'onClick' => "location.href='".site_url()."jenis_simp'" ));
			}
			else
			{
				echo form_button(array('id' => 'button-cancel', 'content' => 'Kembali', 'onClick' => "location.href='".site_url()."jenis_simp'" ));
			}
		?>				
	</div>

<?php echo form_close(); ?>

</div>	

<script type='text/javascript'>
	//Validasi di client
	$(document).ready(function()
	{
		$('#jenis_simp_form').validate({
			errorLabelContainer: "#error",
			wrapper: "li",
			rules: 
			{
				id_jenis_simp: "required",				
				nama_simp: "required"
			}
		});
	});
</script>

